<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    /*
    promise构造函数原型对象上的方法(给promise的实列化使用)
    -then

    -catch

    -finally

    */
    const p = new Promise((resolve, reject) => {
      console.log('请求数据A');
      try {
        setTimeout(() => {
          console.log('成功');
          resolve('1')
        }, 2000)
      } catch (e) {
        reject(e.message)
      }

    })
    console.log('p', p);
  </script>
</body>

</html>